vscode中使用jupyter,一直无法启动内核 failed to start the kernel,有两个提示,py:2205 和py:2160 ,解决方案 |
您所在的位置:网站首页 › vscode kernel died › vscode中使用jupyter,一直无法启动内核 failed to start the kernel,有两个提示,py:2205 和py:2160 ,解决方案 |
一直搜索其他博主的解决办法,尝试各种办法,今天终于解决,我的tensorflow是2.0版本,python是3.7.11 第一步 首先参考文章:(18条消息) VsCode中运行.ipynb,显示内核已被中止(Failed to start the kernel)_Mammalss的博客-CSDN博客 问题特征: 1. 运行.ipynb文件时显示Failed to start the kernel 2. 报错中有Bad file descriptor (C:\projects\libzmq\src\epoll.cpp:100) 问题原因:pyzmq版本过新 在对应环境中查看你的pyzmq版本 pip list查看pyzmq的版本,pyzmq22.3.0版本会使得ipython不能正常工作,致使jupyter无法正常工作,卸载后,安装pyzmq19.0.2版本,即可解决问题 pip uninstall pyzmq # 卸载pyzmq pip install pyzmq==19.0.2 #安装pyzmq19.0.2版本第二步 查看环境中的jupyter库 jupyter --version如果列表中出现有一些库没有安装,:not installed pip intall 相应模块就好了,以我这个举例 pip install jupyter_server pip install jupyterlab这一步完成后关闭vscode,重新打开程序并运行,查看是否正常,内核应该可以启动了,其他问题就有可能是代码调用的问题了 如果你的调用代码是这样的 from keras.datasets import mnist那应该会出现这样的结果 你可以把代码改为 from tensorflow.keras.datasets import mnist重新运行,看看能不能解决。 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |